<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "t_forum_topic_vote".
 *
 * @property string $id
 * @property string $topic_id 投票主题id
 * @property string $content 选项内容
 * @property string $sort 排序
 * @property int $count 得票数
 * @property double $percentage 得票比例
 * @property string $create_by
 * @property string $create_time
 * @property string $update_by
 * @property string $update_time
 * @property int $del_flag
 * @property string $old_id
 */
class TForumTopicVote extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_forum_topic_vote';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'topic_id', 'create_by', 'create_time','content',], 'required'],
            [['count', 'del_flag'], 'integer'],
            [['percentage'], 'number'],
            [['create_time', 'update_time'], 'safe'],
            [['id', 'topic_id', 'create_by', 'update_by'], 'string', 'max' => 36],
            [['content'], 'string', 'max' => 100,'tooLong'=>'{attribute}最多为30个字符。'],
            [['sort'], 'string', 'max' => 1],
            [['old_id'], 'string', 'max' => 255],
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'topic_id' => 'Topic ID',
            'content' => '选项内容',
            'sort' => 'Sort',
            'count' => 'Count',
            'percentage' => 'Percentage',
            'create_by' => 'Create By',
            'create_time' => 'Create Time',
            'update_by' => 'Update By',
            'update_time' => 'Update Time',
            'del_flag' => 'Del Flag',
            'old_id' => 'Old ID',
        ];
    }
}
